var RestService = function () { };

RestService.requestPath = "/default";

RestService.getAll = function($http, callback) {
	$http.get(this.requestPath+"/").success(callback);
};

RestService.getById = function($http, id, callback) {
	$http.get(this.requestPath+"/"+id).success(callback);
};

RestService.save = function($http, object, callback) {
	$http({
        method: "POST",
        url: this.requestPath+"/",
        data: JSON.stringify(object)
    }).success(callback);
};

RestService.update = function($http, object, callback) {
	$http({
		method: "PUT",
		url: this.requestPath+"/"+object.id,
		data: JSON.stringify(object)
	}).success(callback);
};

RestService.delete = function($http, id, callback) {
	$http.delete(this.requestPath+"/"+id).success(callback);
};